Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
Javascript - Modify local class variables with "fly" function

do not hesitate to redirect on answer.

In javascrit I write fly function like with:

class TOTO{
constructor() {
    this.zoomLevel = 1.0;
    //...code...//
    
    this.elementpageWeb.onwheel = function(event){ 
        console.log("I pass here");
        console.log("zoom level = "+this.zoomLevel);
        return false; 
    };

My code works, when I call TOTO class and I move mouseWheel the console.log draw "I pass here" but the variable "this.zoomLevel" is undefined. Than I would like is 1 because is defined just before.

I don't understand how pass and use variable of the class where the function is called.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!